﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="../jquery-easyui-1.4.3/jquery.min.js"></script>
    <script src="../jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
    <link href="../themes/default/easyui.css" rel="stylesheet" />
    <link href="../themes/icon.css" rel="stylesheet" />
	<meta charset="utf-8" />
    <script type="text/javascript">
        $(function () {

       
        $(".Insert").click(function () {
            $("#dlg").dialog({ width: 400, height: 400 })
            .dialog("setTitle", "添加用户")
            .dialog("open");
            $("#frml").attr("src", "AddVIP.html")
        })
        $(".Update").click(function () {
            var row = $("#dg").datagrid("getSelected");
            if(row!=null){
                $("#dlg").dialog({ width: 400, height: 400 }) .dialog("setTitle", "修改用户").dialog("open");
                $("#frml").attr("src", "UpdateVIP.html")
            }
            else {
                $.messager.alert('提示', '请选择需要编辑的行？');
                    
            }
           

        })
        $(".Delete").click(function () {
            $.messager.confirm('确认', '您确认想要删除记录吗？', function (r) {
                if (r) {
                    alert('确认删除');
                }
            });
        })



        $('#dg').datagrid({
            fitColumns: true,
            toolbar: "#td",
            pagination: true,
            singleSelect: true,
            rownumbers:true,
            url: '/jquery-easyui-1.4.3/demo/datagrid/datagrid_data1.json',
            method: "get",
            columns: [[
                { field: 'productid', title: 'Code', width: 100 },
                { field: 'productname', title: 'Name', width: 100 },
                { field: 'unitcost', title: 'Price', width: 100, align: 'right' }
            ]]
        });

        })
    </script>
   
</head>
<body>
    <div id="td">
        <div>
            <a href="#" class="easyui-linkbutton Insert" data-options="iconCls:'icon-add'">增加</a>
            <a href="#" class="easyui-linkbutton Update" data-options="iconCls:'icon-edit'">修改</a>
            <a href="#" class="easyui-linkbutton Delete" data-options="iconCls:'icon-remove'">删除</a>
        </div>
        <div>
            登记管理：<input id="Text1" type="text" />
            <a href="#" class="easyui-linkbutton Search" data-options="iconCls:'icon-search'">查询</a>
        </div>
    </div>

        <table id="dg"></table>  
        

        <div id="dlg" class="easyui-dialog"  style="width:400px;height:200px;"
             data-options="iconCls:'icon-save',resizable:true,modal:true,cache: true,closed: true">
            <iframe id="frml" width="99%" height="99%" frameborder="0"></iframe>
        </div>
      
   
</body>
</html>
